<?php
class Control_Btnlookup extends QUI_Control_Abstract
{
	function render()
	{
		$attrs = $this->attrs();
		$key = isset($attrs['lookup_key'])?$attrs['lookup_key']:'ids';
		$width = isset($attrs['width'])?intval($attrs['width']):500;
		$upurl = $attrs['lookup_url'].'&key='.$key.'&title='.$this->id();
		$alt = isset($attrs['alt'])?$attrs['alt']:'选择';
		$out = Q::control('textbox', $this->id(), $attrs)->render();
		$out .= <<<EOT
		<a class='btnLook' href='$upurl' width='$width' lookupGroup=''>{$alt}</a>
EOT;
		return $out;
	}
}